//
//  CYHomeNewsFooterCell.m
//  cyjf
//
//  Created by tauCross on 2017/7/6.
//  Copyright © 2017年 Auto Financing. All rights reserved.
//

#import "CYHomeNewsFooterCell.h"



@interface CYHomeNewsFooterCell ()

@property(nonatomic, strong)UIImageView *topLine;
@property(nonatomic, strong)UILabel *moreLabel;

@end


@implementation CYHomeNewsFooterCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self)
    {
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        self.topLine = [UIImageView cy_imageLineWithColor:HEXCOLOR(@"ECECEC")];
        [self.contentView addSubview:self.topLine];
        
        self.moreLabel = [[UILabel alloc] init];
        self.moreLabel.textColor = APP_DEFAULT_COLOR_BLUE;
        self.moreLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
        self.moreLabel.text = @"查看更多";
        [self.moreLabel sizeToFit];
        [self.contentView addSubview:self.moreLabel];
    }
    return self;
}

+ (CGFloat)heightForObject:(id)object atIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
{
    return 44;
}

- (BOOL)shouldUpdateCellWithObject:(id)object
{
    [self setNeedsLayout];
    return YES;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.topLine.height = 1 / SCREEN_SCALE;
    self.topLine.width = self.contentView.width;
    self.topLine.left = 0;
    self.topLine.top = 0;
    
    self.moreLabel.centerX = self.contentView.width / 2;
    self.moreLabel.centerY = self.contentView.height / 2;
}

@end
